package cate.game.role.farm.spicefb.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBSpiceFb;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@ClientMsg(title = "领取水晶峡谷宝箱 の 请求")
@OperationSetter(value = GDOperation.SPICE_FB_BOX_RWD, sub = "tid")
public class GetSpiceFbStarRewardReq implements MsgInput {
    @NoteField(value = "宝箱的tid")
    public int tid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<Void> r = cc.getRole().getFarm().spiceFb.getStarReward(tid);
        if(!r.ok()){
            game.notice.message(cc.getRole(), r.message);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBSpiceFb.STAR_REWARD_REQ;
    }
}
